#ifndef WIDGET2_H
#define WIDGET2_H

#include <QWidget>
#include <QTcpSocket>
#include <QAbstractSocket>

namespace Ui {
class widget2;
}

class widget2 : public QWidget
{
    Q_OBJECT

public:
    explicit widget2(const QString &username, QWidget *parent = nullptr);
    ~widget2();

signals:
    void closed();

protected:
    void closeEvent(QCloseEvent *event) override;

private slots:
    void on_chaxun_clicked();
    void on_pushButton_2_clicked();
    void onConnected2();
    void onReadyRead2();
    void onError2(QAbstractSocket::SocketError socketError);

private:
    Ui::widget2 *ui;
    QString m_username;
    QTcpSocket *socket2;
};

#endif // WIDGET2_H
